package jianzhi_offer;

public class _7_跳台阶 {
	public int JumpFloor(int target) {
		if(target == 1) return 1;
		if(target == 2) return 2;
		int dp1 = 1, dp2 = 2;
		for(int i=3;i<=target;++i) {
			int now = dp1+dp2;
			dp1 = dp2;
			dp2 = now;
		}
		return dp2;
    }
}
